package com.sunsun_china.www.aq.base;

import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.igexin.sdk.PushConsts;
import com.sunsun_china.www.aq.AqMessageNotification;

/**
 * Created by 赵武 on 2015/4/2.
 */
public class PushDemoReceiver extends BroadcastReceiver {
	@Override
	public void onReceive(Context context, Intent intent) {
		Bundle bundle = intent.getExtras();
		switch (bundle.getInt(PushConsts.CMD_ACTION)) {
			case PushConsts.GET_MSG_DATA:
				// 获取透传（payload）数据
				byte[] payload = bundle.getByteArray("payload");
				if (payload != null)
				{
					try {
						String data = new String(payload);
						AqMessageNotification.notify(context, data, 0);
					}catch (Exception e) {
					}
				}
				break;
			default:
				break;
		}
	}
}
